In this video we learn how to create our very first interactive bloodily graph in our Jupiter notebook.
And in principle there are two options how to create a plot graph.
So either you can create and host your properly graph online on the plot platform but for this you need
to create an account.
And the second alternative is that we create and view our graph off line in a two bit and notebook.
And this is exactly what we will do in this course.
So we create the offline properly graphs and therefore there's no need to create an account.
So let's start and we import pen does and the to create a properly graphs.
We simply need to impart cufflinks.
And uh we do this as the CEF.
So this is a convention here.
And then we are importing the stock data from our stocks.
Yes we file and we simply select.
The closing prices.
So let's have a look.
So here we have our six stocks and we've already learned that plotting normalized stock prices.
So for example each and every stock starts at a base value of 100.
So this is actually more meaningful and that's more easy to compare and uh therefore we create the normalized
uh data frame with normalized stock prices.
So this is nothing new here.
And let's have a look.
So we are starting at a stock price of 100 and then we could actually create an interactive price chart
with Flatley.
And we simply have to use uh the I plot method on our data frame.
So let's try this out here.
And if we get an error message so we do not have a user name and an account.
And actually what we tried to do here we tried to plot and to host our plot online on the plot Leh platform.
And this does obviously not work because we didn't create an account and therefore we get an error message
here.
But anyway our plan is to only create an off line graph here and our job at a notebook.
And there are actually two ways how to overcome this problem and how to create off line graphs and there's
a non-permanent way to do this and a permanent way.
And let's go to the non-permanent solution.
So let's create here a new cell and then we can make an instruction that uh we want to create an off
line graph and uh we can do this with the cuff links the method go off line.
So let's have a look.
So here we have uh go off line and we do not need to pass any argument or parameter and let's simply
run the cell here and let's retry it to create yeah our interactive price chart
and uh we can see now that we have successfully created our interactive price chart and of course there's
also the option to go online again.
And no surprise we can do this with the cufflinks method go online
so here we have the method go online.
And if uh we run the method here and if we again try to create our plot
then again we get the error message Yes we try to create our plot online and uh we do not have an account.
So let's uh rerun the go off line method and uh let's again create yeah our graph
so this works.
And before I said that using the go off line method is a non-permanent way how to do this.
And non-permanent means that if we restart the kernel.
So we restart and uh clear the output
and the fear rerun here our code.
So we imported the stocks we normalize that
and now if we do not read run we go offline method and simply tried to create here the interactive graph.
Then again we get to the error message.
So in each and every Jupiter note book session we need to run the go off line code and then it works
so running the go off line method in each and every session is maybe a bit uncomfortable.
And uh there's also a permanent solution.
So let's again restart.
And to clear the output
and uh let's delete.
Yeah our go off line and go online uh sales here and uh let's rerun the other code
so again we are getting here an error message.
And that's actually a permanent solution that we only have to run once.
And uh then if we have uh run the code once uh then in each and every two but an output session then
automatically we can plot our graphs offline without having to explicitly determine that we want to
grow a plot.
The graph off line and we can do this with uh the cuff links method set config file.
So let's do this so give you a further method.
Set config file.
And uh here we have the parameter off line and we have to pass true.
So let's run this out here and let's retry to create our plot here
and now let's delete here the cell.
So we delete.
And then again we restart and uh clear the output
and uh then again we try to run.
Yeah.
Our code without explicitly saying that we want to create an off line graph.
And uh this should work.
Now actually
so let's try this out.
And here we have our graph.
So if you do want to work permanently off line when creating properly graphs then actually the best
solution would be to apply the set config file method once and pass true to the offline parameter and
uh with this we are finished here with this video and in the next video we are starting to create and
analyze our inductive graph.
So hope to see you there by.